package form;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Test {
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(8888);
        System.out.println("服务器已经开启");
        Socket accept = serverSocket.accept();
        BufferedOutputStream bos = new BufferedOutputStream(accept.getOutputStream());
        BufferedInputStream bis = new BufferedInputStream(accept.getInputStream());
        byte[] bytes = new byte[102400];
        int len = bis.read(bytes);
        System.out.println(new String(bytes,0,len));

        bos.write("回应前端页面".getBytes());
        bos.flush();
    }
}
